<script setup>
import { inject } from 'vue'
const sonStr = inject('toSon', '你还没传呢')
const sonFn = inject('fn')
const sonNum = inject('num')

const btnClick = () => {
  console.log(sonNum.value)
  console.log(sonFn)
  console.log(sonStr)
}

const loadingFn = inject('showFn')
</script>

<template>
  <div class="son-page">son---{{ sonStr }}</div>
  <button @click="sonFn(Date.now())">调用fn</button>
  <hr />
  <h3>{{ sonNum }}</h3>
  <button @click="btnClick">获取sonNum</button>
  <button @click="loadingFn(true)">控制loading显示</button>
  <button @click="loadingFn(false)">控制loading隐藏</button>
</template>

<style lang="scss" scoped></style>
